package com.zzuli.dcxt.controller;

import com.zzuli.dcxt.entiy.Admin;
import com.zzuli.dcxt.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;
    @RequestMapping("/login")
    public String login(Admin admin , HttpSession session){
        Admin login = adminService.login(admin);
        session.setAttribute("admin",admin);
        return "index";
    }

}
